Skip to content

[asan] Fix-forward undefined type in test from #153142 #153636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2025

Conversation

thurstond
Copy link
Contributor

Fix Mac build breakage (reported by aeubanks in #153142 (comment)) by including stdint.h and using uintptr_t

Reported in llvm#153142 (comment)

Fix by including stdint.h and using uintptr_t
@llvmbot
Copy link
Member

llvmbot commented Aug 14, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Thurston Dang (thurstond)

Changes

Fix Mac build breakage (reported by aeubanks in #153142 (comment)) by including stdint.h and using uintptr_t


Full diff: https://github.com/llvm/llvm-project/pull/153636.diff

1 Files Affected:

  • (modified) compiler-rt/test/asan/TestCases/Posix/fakestack_alignment.cpp (+2-1)
diff --git a/compiler-rt/test/asan/TestCases/Posix/fakestack_alignment.cpp b/compiler-rt/test/asan/TestCases/Posix/fakestack_alignment.cpp
index ee52c405ae1a3..b25f3210e84f4 100644
--- a/compiler-rt/test/asan/TestCases/Posix/fakestack_alignment.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/fakestack_alignment.cpp
@@ -22,6 +22,7 @@
 #include <assert.h>
 #include <pthread.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -35,7 +36,7 @@ bool misaligned = false;
 // happen by chance, so try this on many threads.
 void *Thread(void *unused) {
   big_object x;
-  uint alignment = (unsigned long)&x % alignof(big_object);
+  uintptr_t alignment = (uintptr_t)&x % alignof(big_object);
 
   if (alignment != 0)
     misaligned = true;

Copy link

github-actions bot commented Aug 14, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@thurstond thurstond merged commit 37cc010 into llvm:main Aug 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants